<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui-v2.4.5/layui/css/layui.css">
    <script src="layui-v2.4.5/layui/layui.js"></script>
</head>
<body>
     <div style="width: 50%;margin-left: 25%;margin-top: 100px;">
         <textarea id="demo" style="display: none;"></textarea>
         <button id="btn">获取内容</button>
     </div>
</body>
<script>
    layui.use(['layedit','jquery'], function(){
        var layedit = layui.layedit;
        var $ = layui.jquery;
        var index = layedit.build("demo",{
            height:100
        });
        
        $("#btn").on("click",function () {
            var text = layedit.getText(index);
            console.log("text:"+text);

            var content = layedit.getContent(index);
            console.log("content:"+content);
        });
    });
</script>
</html>